package org.jsola.hr.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.user.example.UserExample.*;

/**
 * @author june
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【用户】的参数")
@Data
public class AddUserDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull
    @Length(max = 255)
    private String name;

    @ApiModelProperty(notes = N_PHONE, example = E_PHONE)
    @NotNull
    @Length(max = 45)
    private String phone;

    @ApiModelProperty(notes = N_AVATAR, example = E_AVATAR)
    @Length(max = 500)
    private String avatar;

    @ApiModelProperty(notes = N_PASSWORD, example = E_PASSWORD)
    @Length(max = 255)
    private String password;

    @ApiModelProperty(notes = N_EMAIL, example = E_EMAIL)
    @Length(max = 255)
    private String mailbox;

    @ApiModelProperty(notes = "角色id，可不传", example = "1")
    private Long roleId;

    @ApiModelProperty(notes = "人力角色id", example = "1")
    @NotNull(message = "人力角色不能为空")
    private Long hrRoleId;

    @ApiModelProperty(notes = "邮箱", example = "")
    private String email;

    @ApiModelProperty(notes = "用工单位分组ids")
    private List<String> childCompanyIdList;

    @ApiModelProperty(notes = "用工单位ids")
    private List<String> employerIdList;

    @ApiModelProperty(notes = "是否是全部用工单位分组", example = "1:是,0:否")
    private Boolean isAllChildCompany;

    @ApiModelProperty(notes = "是否只读用户", example = "1:是,0:否")
    private Boolean isReadOnly;

}

